package com.yunst.execute.impl;

import com.yunst.execute.ExecuteOperation;

import java.awt.*;
import java.awt.image.BufferedImage;

/**
 * @author yunst
 * @date 2022/12/29
 */
public class ScreenShotExecute implements ExecuteOperation<BufferedImage> {

    public BufferedImage execute() throws AWTException {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        return robot.createScreenCapture(new Rectangle((int) screenSize.getWidth(), (int) screenSize.getHeight()));
    }
}
